<template>
  <div id='app'>
    <el-container style="height: calc(100vh - 110px); border: 1px solid #eee">
      <el-aside  width="250px" style="background-color: rgb(238, 241, 246)">
        <el-menu @select="jump" default-active="入库管理" >
          <el-submenu :index="item.pname" v-for="(item,i) in menuList" :key="i">
            <template slot="title"><i class="el-icon-message"></i><span slot="title">{{item.pname}}</span></template>
            <el-menu-item-group>
              <el-menu-item v-for="(item2,i2) in item.childList" :key="i2" :index="item2.name">{{item2.name}}</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: left; font-size: 22px">
          <span>{{title}}</span>
        </el-header>
        <el-main>
          <helpDoc></helpDoc>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import helpDoc from '@/components/helpDoc/index'
export default {
  components:{
    helpDoc
  },
  data() {
    return {
      title:'',
      menuList:[
        {
          pname:'进销存管理',
          childList:[
            {name:'入库管理'},
            {name:'库存管理'},
            {name:'出库管理'}
          ]
        },
        {
          pname:'媒体播放系统',
          childList:[
            {name:'素材管理'},
            {name:'广告制作'},
            {name:'播放计划'},
            {name:'广告屏系统'}
          ]
        },
        {
          pname:'电梯投保',
          childList:[
            {name:'投保查询'}
          ]
        },
        {
          pname:'基础管理',
          childList:[
            {name:'往来单位'},
            {name:'设备管理'},
            {name:'厂家管理'},
            {name:'BOM'}
          ]
        },
        {
          pname:'电梯管理',
          childList:[
            {name:'电梯绑定'},
            {name:'电梯导入'},
            {name:'电梯审核'},
            {name:'备案申请'}
          ]
        }
      ]
    }
  },
  methods:{
    jump(index,path){
      this.title = index
      console.log(path)
    }
  },
  mounted() {
    this.$storage.set('upUrl', JSON.stringify({ 'path': '/operation/help/helpDoc' }))
  },
};
</script>

<style lang="scss" scoped>
  .el-header {
    background-color: var(--panelWrapTitle);
    color: #fff;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>